package com.icedevcloud.upms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.icedevcloud.common.core.mybatis.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author XiaoBingBy
 * @since 2023-08-21
 */
@Getter
@Setter
@TableName("sys_permission")
@Schema(name = "SysPermission", description = "$!{table.comment}")
public class SysPermission extends BaseEntity {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "租户编号")
    private String tenantNo;

    @Schema(description = "父ID")
    private Long pid;

    @Schema(description = "权限名称")
    private String permName;

    @Schema(description = "权限编码")
    private String permCode;

    @Schema(description = "路由地址")
    private String path;

    @Schema(description = "路由地址名称")
    private String pathName;

    @Schema(description = "组件路径")
    private String component;

    @Schema(description = "图标")
    private String icon;

    @Schema(description = "网页链接")
    private String url;

    @Schema(description = "排序号")
    private Integer sort;

    @Schema(description = "设为true后在左侧菜单不会显示该页面选项")
    private Integer hidden;

    @Schema(description = "设为true后页面缓存")
    private Integer cache;

    @Schema(description = "类型（D目录 M菜单 B按钮）")
    private String permType;

    @Schema(description = "状态 1-启用 0-禁用")
    private Integer status;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "子权限")
    private transient List<SysPermission> children;

}
